package test;

import de.fhhof.robot.control.IMessage;
import de.fhhof.robot.control.Message;
import de.fhhof.robot.control.net.IConnection;

public class AborThread implements Runnable{

	private IConnection server;
	
	@Override
	public void run() {
		 System.out.println("Executing abort command...");
		 IMessage msgAbort2 = new Message("K002", "");
		 server.send(msgAbort2);
		 System.out.println("Abort message sent ");
		 IMessage m1 = server.receive();
		 System.out.println("Receive ack1: "+ m1.getCommand());
/*		 if(m1!= null){
			 IMessage m2 = server.receive();
			 System.out.println("Receive ack2: "+ m2.getCommand());
		 }*/
		System.out.println("Abort command executed");
	}

	public IConnection getServer() {
		return server;
	}

	public void setServer(IConnection server) {
		this.server = server;
	}

}
